﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;
using DataAccess;

namespace Business
{
    public class XuLyTimChuyenBay
    {
        ChuyenBay _chuyenbay = new ChuyenBay();
        string sanBayDen;

        public string SanBayDen
        {
            get { return sanBayDen; }
            set { sanBayDen = value; }
        }
        string sanBayDi;

        public string SanBayDi
        {
            get { return sanBayDi; }
            set { sanBayDi = value; }
        }

        public ChuyenBay chuyenbay
        {
            get { return _chuyenbay; }
            set { _chuyenbay = value; }
        }
        DataTable _datatable;
        public DataTable datatable
        {
            get { return _datatable; }
            set { _datatable = value; }
        }
        DataTable _datatable2;

        public DataTable datatable2
        {
            get { return _datatable2; }
            set { _datatable2 = value; }
        }
        DateTime ngayVe;

        public DateTime NgayVe
        {
            get { return ngayVe; }
            set { ngayVe = value; }
        }
        public void ThucThi()
        {
            TruyXuatTimChuyenBay tcb = new TruyXuatTimChuyenBay();
            tcb.cb= chuyenbay;
           tcb.SanBayDi = this.SanBayDi;
           tcb.SanBayDen = this.SanBayDen;
            if(chuyenbay.NgayDi!=null)
           tcb.cb.NgayDi = (DateTime)Convert.ToDateTime(chuyenbay.NgayDi.ToShortDateString());
            if(NgayVe!=null)
           tcb.NgayVe = (DateTime)Convert.ToDateTime(this.NgayVe.ToShortDateString());
          datatable= tcb.ThongTinChuyenBay();
          datatable2 = tcb.ThongTinChuyenBayVe();
        }
    }
}
